﻿@model viBook.Models.ChangePasswordModel

@{
    ViewBag.Title = "Change Password";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section HeadContent{
    <link href="@Url.Content("~/Content/jquery.realperson.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.realperson.js")" type="text/javascript"></script>
}

<div class="group">
    <div class="full">
        <h1>
            Edit profile</h1>
        <p>
            Edit information, avatar, etc...</p>
    </div>
</div>
<div id="main">
    @Html.Partial("_EditProfilePartial")
    @using (Html.BeginForm("ChangePassword","Account", FormMethod.Post, new {@class = "gen-form with-messages"})) {
        @Html.ValidationSummary(true, "Password change was unsuccessful. Please correct the errors and try again.")
            <div class="form-field">
                <fieldset>
                    @Html.LabelFor(m => m.OldPassword)
                    @Html.PasswordFor(m => m.OldPassword, new {@class = "form-text"})
                </fieldset>
                <div class="message">
                    @Html.ValidationMessageFor(m => m.OldPassword)
                </div>
            </div>

            <div class="form-field">
                <fieldset>
                    @Html.LabelFor(m => m.NewPassword)
                    @Html.PasswordFor(m => m.NewPassword, new { @class = "form-text" })
                </fieldset>
                <div class="message">
                    @Html.ValidationMessageFor(m => m.NewPassword)
                </div>
            </div>

            <div class="form-field">
                <fieldset>
                    @Html.LabelFor(m => m.ConfirmPassword)
                    @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-text" })
                </fieldset>
                <div class="message">
                    @Html.ValidationMessageFor(m => m.ConfirmPassword)
                </div>
            </div>

            <div class="form-field realperson-regen">
                <fieldset>
                    @Html.LabelFor(m => m.RealPerson)
                    @Html.TextBoxFor(m => m.RealPerson, new { @class = "form-text" })
                    <p class="message">@Html.ValidationMessageFor(m => m.RealPerson)</p>
                    <div id="defaultReal">
                    </div>
                </fieldset>
            </div>

            <div class="form-btns">
                <input class="form-sub" name="commit" type="submit" value="Change Password" />
                @Html.ActionLink("Cancel", "Index", "Account", new { @class = "form-btn" })
            </div>
    }
</div>

<script type="text/javascript">
    $("#RealPerson").css("margin", "0");
    $(function () {
        $('#defaultReal').realperson({
            length: 6,
            includeNumbers: true,
            hashName: 'realHash'
        });
    });
</script>